<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <th:block th:replace="include/css"/>
    <link rel="stylesheet" type="text/css" href="/static/css/knowledge.css">
    <title>知识库</title>
</head>
<body>
<th:block th:replace="include/header:: header"/>
<div class="main">
    <div class="leftKnowledge whitebk">
        <div class="contribute">
            <span><a href="javascript:;" id="publicKnowledgeBtn"><em>我要投稿</em></a></span>
        </div>
        <ul class="treelist">
            <li class="tatalCategory">
                <a class="maintitle fa" href="/knowledge"><i class="fa fa-cubes"></i><em>全部分类</em></a>
            </li>
            <li>
                <ul>
                    <th:block th:each="category:${categories}">
                        <th:block th:if="${#lists.size(category.children)>0}">
                            <li>
                                <a href="javascript:;" class="slowshow"
                                   th:attr="pCategoryId=${category.categoryId}"><b></b><em
                                        th:text="${category.name}"></em><i>-</i></a>
                                <ul style="">
                                    <li th:each="children:${category.children}"><a
                                            th:href="'/knowledge/categoryId/'+${children.categoryId}"><b></b><em
                                            th:text="${children.name}"></em></a>
                                    </li>
                                </ul>
                            </li>
                        </th:block>
                        <th:block th:unless="${#lists.size(category.children)>0}">
                            <li>
                                <a th:href="'/knowledge/pCategoryId/'+${category.categoryId}" class=""><b></b><em
                                        th:text="${category.name}"></em></a>
                            </li>
                        </th:block>
                    </th:block>
                </ul>
            </li>
        </ul>
    </div>
    <div class="rightKnowledge whitebk">
        <div class="rightContent">
            <div class="knowledgeTitle" style="cursor: default">
                <div class="title"><a href=""
                                      th:text="${#strings.defaultString(KnwoledgeTitleCategory?.name,'JAVA情书')}"></a>
                </div>
                <div class="clear"></div>
                <p style="text-indent: 2em;"
                   th:text="${#strings.defaultString(KnwoledgeTitleCategory?.desc,'你是静态代码块，执行在类加载，我是局部变量i，无限循环，爱你，痴心不改。')}"></p>
                <div class="mainRightContent">
                    <div class="tab_title" id="tab_title">
                        <span class="xian bordercolor"></span>最新收录
                    </div>
                    <div class="knwoledgeList">
                        <div class="topic-item-list">
                            <div class="topic-item" th:if="${result.page.pageTotal>0}" th:each="item:${result.list}">
                                <div class="topic-item-info">
                                    <div class="topic-item-title">
                                        <a th:href="'/knowledge/'+${item.topicId}" class="title"
                                           th:text="${item.title}"></a>
                                        <span class="time"
                                              th:text="${#strings.defaultString(#temporals.format(item.createTime,'yyyy-MM-dd HH:mm:ss'),'未知时间')}"></span>
                                        <a class="topic-cate-tag"
                                           th:href="'/knowledge/categoryId/'+${item.categoryId}"><span
                                                th:text="${item.categoryName}"></span></a>
                                    </div>
                                    <div class="topic-item-summary" th:text="${item.summary}"></div>

                                    <div class="image-thum topic-item-images"
                                         th:if="${!#lists.isEmpty(item.topicImageArray)&&#lists.size(item.topicImageArray)>0}">

                                        <a class="showImage" href="javascript:;" th:each="img,l:${item.topicImageArray}"
                                           th:if="${l.index<=2}"><img class="img-thumbnail" th:src="${img}"/></a>
                                        <div class="clear"></div>
                                    </div>

                                    <div class="topic-count-info">
                                        <a th:href="'/user/'+${item.userId}" class="user-info"><i
                                                class="icon icon-user-name"></i><span th:text="${item.userName}"></span></a>
                                        <span class="count"><i class="icon icon-read"></i><span>阅读：<th:block
                                                th:text="${#strings.defaultString(item.readCount,0)}"/></span></span>
                                        <span class="count"><i class="icon icon-comment"></i><span>评论：<th:block
                                                th:text="${#strings.defaultString(item.commentCount,0)}"/></span></span>
                                        <span class="count"><i class="icon icon-like"></i><span>喜欢：<th:block
                                                th:text="${#strings.defaultString(item.likeCount,0)}"/></span></span>
                                        <span class="count"><i class="icon icon-collection"></i><span>收藏：<th:block
                                                th:text="${#strings.defaultString(item.collectionCount,0)}"/></span></span>
                                    </div>
                                </div>
                                <div class="clear"></div>
                            </div>
                            <div class="no-data" th:unless="${result.page.pageTotal>0}">没有帖子，赶紧抢沙发吧</div>
                            <div class="clear"></div>
                        </div>
                        <div id="page" class="page"></div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<div class="clear"></div>
<th:block th:replace="include/footer:: footer"/>
<th:block th:replace="include/top"/>
<script type="text/javascript" src="/static/js/knowledge.js"></script>
<script type="text/javascript" charset="utf-8" src="/static/laypage/laypage.js"></script>
<script th:inline="javascript">
    fzqblog.pageTotal = [[${result.page.pageTotal}]]
</script>
</body>
</html>